package net.hn.hnms.biz.cockpit.controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import net.hn.hnms.biz.cockpit.domain.*;
import net.hn.hnms.biz.cockpit.domain.vo.*;
import net.hn.hnms.biz.cockpit.service.*;
import net.hn.hnms.sys.common.core.domain.R;
import net.hn.hnms.sys.common.satoken.config.AutoSetMineCode;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Api(value = "综合驾驶舱", tags = {"综合驾驶舱"})
@RestController
@RequestMapping("/cockpit/Integrated")
public class IntegratedCockpitController {


    @Resource
    private IAutomaticSystemService automaticSystemService;

    @Resource
    private IWorkflowSystemService workflowSystemService;

    @Resource
    private IMonitoringSystemService monitoringSystemService;

    @Resource
    private IMineCompositeIndicatorService mineCompositeIndicatorService;

    @Resource
    private IWarnInfoService warnInfoService;

    @Resource
    private IMonthThreeViolationsService monthThreeViolationsService;

    @Resource
    private IYearRiskService yearRiskService;

    @Resource
    private IYearHiddenTroubleService yearHiddenTroubleService;

    /**
     * 自动化指标
     */
    @ApiOperation("自动化指标")
    @GetMapping("/automate")
    @AutoSetMineCode
    public R<List<AutomaticSysVo>> getAutomaticSysList(String mineCode) {
        return R.ok(automaticSystemService.getAutomaticSysList(mineCode));
    }


    @ApiOperation("业务系统")
    @GetMapping("/workflow")
    @AutoSetMineCode
    public R<WorkflowSystem> getWorkflowInfo(String mineCode) {
        return R.ok(workflowSystemService.getWorkflowInfo(mineCode));
    }


    @ApiOperation("感知系统")
    @GetMapping("/monitor")
    @AutoSetMineCode
    public R<List<MonitoringSystem>> getMonitorInfo(String mineCode) {
        return R.ok(monitoringSystemService.getMonitorInfo(mineCode));
    }

    @ApiOperation("矿综合指标")
    @GetMapping("/mineral")
    @AutoSetMineCode
    public R<MineCompositeIndicator> getMineralInfo(String mineCode) {
        return R.ok(mineCompositeIndicatorService.getMineralInfo(mineCode));
    }


    @ApiOperation("预警详情")
    @GetMapping("/warn")
    @AutoSetMineCode
    public R<List<WarnInfo>> getWarnInfo(String mineCode) {
        return R.ok(warnInfoService.getWarnInfo(mineCode));
    }

    @ApiOperation("当月三违管理")
    @GetMapping("/threeViolations")
    @AutoSetMineCode
    public R<ThreeViolationsVo> threeViolations(String mineCode) {
        return R.ok(monthThreeViolationsService.getThreeViolations(mineCode));
    }

    @ApiOperation("当年风险管控")
    @GetMapping("/riskControl")
    @AutoSetMineCode
    public R<RiskControlVo> riskControl(String mineCode) {
        return R.ok(yearRiskService.getRiskControl(mineCode));
    }

    @ApiOperation("当年隐患排查")
    @GetMapping("/danger")
    @AutoSetMineCode
    public R<YearHiddenTroubleVo> getYearDanger(String mineCode) {
        return R.ok(yearHiddenTroubleService.getYearDanger(mineCode));
    }

}
